package com.hzzc.sso.sdk;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import retrofit.RestAdapter;

/**
 * @author Administrator
 */
@Slf4j
@Configuration
@EnableConfigurationProperties(value = SSOAppSdkProperties.class)
public class SsoAppSdkConfig {


    @Autowired
    private SSOAppSdkProperties ssoWebSdkProperties;

    /**
     * 远程数据库地址
     *
     * @return
     */
    @Bean
    public RemoteUserAuthorityService remoteUserAuthorityService() {
        String ssoServer = ssoWebSdkProperties.getSsoServer();
        RestAdapter restAdapter = new RestAdapter.Builder().setEndpoint(ssoServer).build();
        return restAdapter.create(RemoteUserAuthorityService.class);
    }

}
